home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Applications / Macintosh Tracker 1.20 / source / Tracker Client Folder / CSpecificVolume.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-18  |  1000 b   |  49 lines  |  [TEXT/KAHL]

  1. /* CSpecificVolume.c */
  2.  
  3. #include "CSpecificVolume.h"
  4. #include "CMyDocument.h"
  5. #include "LocationConstants.h"
  6. #include "CWindow.h"
  7. #include "CArray.h"
  8.  
  9. #define MINVolume (0)
  10. #define MAXVolume (255)
  11.  
  12.  
  13. void                CSpecificVolume::ISpecificVolume(CMyDocument* TheDocument,
  14.                             CWindow* TheWindow)
  15.     {
  16.         LongPoint            LocalStart,LocalExtent;
  17.  
  18.         Document = TheDocument;
  19.         GetRect(SpecificVolumeTEID,&LocalStart,&LocalExtent);
  20.         INumberText(LocalStart,LocalExtent,applFont,9,TheWindow,TheWindow);
  21.     }
  22.  
  23.  
  24. void                CSpecificVolume::StoreValue(void)
  25.     {
  26.         long            Temp;
  27.         SongRec        Song;
  28.  
  29.         if (Dirty && (Document->Selection != -1))
  30.             {
  31.                 Temp = GetValue();
  32.                 if (Temp < MINVolume)
  33.                     {
  34.                         Temp = MINVolume;
  35.                     }
  36.                 if (Temp > MAXVolume)
  37.                     {
  38.                         Temp = MAXVolume;
  39.                     }
  40.                 Document->ListOfSongs->GetElement(Document->Selection,&Song);
  41.                 if (Song.VolumeOverrideDefault && (Song.Volume != Temp))
  42.                     {
  43.                         Document->SetVolume(Temp);
  44.                     }
  45.                 SetValue(Temp);
  46.             }
  47.         inherited::StoreValue();
  48.     }
  49.